Skip to content

FED-4495 System sx migrator#329

Merged
btr-rmconsole-1[bot] merged 43 commits intomasterfrom
system-sx-migrator
Feb 26, 2026
Merged

FED-4495 System sx migrator#329
btr-rmconsole-1[bot] merged 43 commits intomasterfrom
system-sx-migrator

Conversation

@greglittlefield-wf
Copy link
Copy Markdown
Contributor

@greglittlefield-wf greglittlefield-wf commented Feb 24, 2026

Motivation

MUI v6 deprecated system props on its components, instructing consumers to migrate to sx instead: https://mui.com/material-ui/migration/migrating-from-deprecated-apis/#system-props

We have some MUI Dart wrappers that should be migrated, that their existing codemod won't work for.

Changes

  • Add mui_system_props_migration codemod executable, which migrates system props to sx
    • Detects usages of OverReact props that wrap MUI components regardless of where they're defined (duck-typing them by looking for sx and deprecated system props)
      • This allows us to run tests in CI in this OSS repo, and had the bonus of automatically handling the Link component I originally missed
    • Handles edge cases of existing sx props and prop forwarding, merging them while preserving existing behavior as best as possible
      • Most cases are handled automatically, but some require manual intervention and will get a FIXME comment with context on how to address
  • Add tests

Example migration

Before (system props):

(Box()..m = 2)();
(Box()
  ..m = 2
  ..sx = {'color': '#f00'}
)()
(Box()
  ..m = 2
  ..addProps(props.getPropsToForward())
)()

After (all system props migrated to SX):

(Box()..sx = {'m': 2})()
(Box()..sx = {
  'm': 2,
  'color': '#f00'
})()
(Box()
  ..addProps(props.getPropsToForward())
  ..sx = {
    'm': 2,
    ...?props.sx,
  }
)()

Release Notes

Review

See CONTRIBUTING.md for more details on review types (+1 / QA +1 / +10) and code review process.

Please review:

QA Checklist

  • Tests were updated and provide good coverage of the changeset and other affected code
  • Manual testing was performed if needed
    • Steps from PR author:
      • Verify tests run in CI and pass
      • Run the codemod locally on a few repos to make sure the codemod doesn't crash, and verify output looks good and FIXME comments show up where expected and make sense
        dart pub global activate --source=git --git-ref=system-sx-migrator https://github.com/Workiva/over_react_codemod
        mui_system_props_migration --yes-to-all
        ddev format
        
    • Anything falling under manual testing criteria outlined in CONTRIBUTING.md

Merge Checklist

While we perform many automated checks before auto-merging, some manual checks are needed:

  • A Frontend Frameworks Design member has reviewed these changes
  • There are no unaddressed comments - this check can be automated if reviewers use the "Request Changes" feature
  • For release PRs - Version metadata in Rosie comment is correct

@greglittlefield-wf greglittlefield-wf changed the title System sx migrator System props to sx codemod Feb 25, 2026
@greglittlefield-wf greglittlefield-wf changed the title System props to sx codemod MUI system props to sx codemod Feb 25, 2026
@btr-rmconsole-3 btr-rmconsole-3 bot changed the title MUI system props to sx codemod FED-4495 System sx migrator Feb 25, 2026
@greglittlefield-wf greglittlefield-wf marked this pull request as ready for review February 25, 2026 21:56
kealjones-wk
kealjones-wk previously approved these changes Feb 26, 2026
Copy link
Copy Markdown
Contributor

@kealjones-wk kealjones-wk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+10

Comments about possible changes are totally optional... seems like it covers everything really well. Nice work.


const sxPrecedenceFixme =
'// FIXME(mui_system_props_migration) - Previously, it was possible for forwarded system props to overwrite these migrated styles, but not anymore since sx takes precedence over any system props.'
'\n // Double-check that this new behavior is okay.';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a hard thing to consider... so this is only really an issue when the usage of the component hasn't been migrated to sx and is still using system props... I was gonna say what if we made a utility like systemPropsToSx(props) that would just like grab any system props name and move it into the props.sx object... but like that seems like overkill and like it is a pretty unlikely case.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good though; yeah my guess is that it's unlikely enough that we probably shouldn't worry about up front, but we can always do that down the road if it becomes an issue!

Copy link
Copy Markdown
Contributor

@kealjones-wk kealjones-wk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+10

@greglittlefield-wf
Copy link
Copy Markdown
Contributor Author

@Workiva/release-management-p

Copy link
Copy Markdown

@rmconsole-wf rmconsole-wf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 from RM

@btr-rmconsole-1 btr-rmconsole-1 bot merged commit aa69a1c into master Feb 26, 2026
10 checks passed
@btr-rmconsole-1 btr-rmconsole-1 bot deleted the system-sx-migrator branch February 26, 2026 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants